<script setup>
import { ref } from 'vue'

const {item, edit, del} = defineProps(['item', 'edit', 'del'])
const toggle = (id) => {
  edit(id)
}
const delBtn = () => {
  del(item.id)
}
const count = ref(0)
</script>

<template>
  <div class="Item" :class="{underLine: item.status ? true : false}">
    <input type="checkbox" @change="toggle(item.id)" :checked="item.status" :id="item.id">
    <label :for="item.id">{{ item.title }}</label>
    <button @click="delBtn">删除</button>
  </div>
</template>

<style scoped>
.underLine {
  text-decoration: line-through;
}
</style>
